select * from stories where StoryId=#TheID# Story ###TheID# does not exist.

Story ###TheID# Deleted.
select * from stories where photo='#photo#' and not storyId = #TheID#
Photo #photo# Deleted.
Delete from stories where Storyid=#theid#